﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Data;

public partial class Ticksys_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }/*
    protected void BtnIngresar_Click(object sender, EventArgs e)
    {
        string Consulta = "SELECT * FROM Usuarios WHERE Username = '" + txt_username.Text + "' AND Password = '" + txt_clave.Text + "' AND Eliminado = 0";

        DataSet ds = AccesoDatos.Consulta(Consulta);

        if (ds.Tables[0].Rows.Count == 0)
        {
            lbl_Error.Text = "Error";
        }
        else
        {
            
            FormsAuthentication.RedirectFromLoginPage(ds.Tables[0].Rows[0]["Username"].ToString(),false);
            lbl_Error.Text = Page.User.Identity.Name;
        }
    }*/
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string Consulta = "SELECT * FROM Usuarios WHERE Username = '" + txt_username.Text + "' AND Password = '" + txt_clave.Text + "' AND Eliminado = 0";

        DataSet ds = AccesoDatos.Consulta(Consulta);

        if (ds.Tables[0].Rows.Count == 0)
        {
            lbl_Error.Visible = true;
        }
        else
        {

            FormsAuthentication.RedirectFromLoginPage(ds.Tables[0].Rows[0]["Username"].ToString(), false);
            lbl_Error.Text = Page.User.Identity.Name;
        }
    }
}